package ai.people.netmon.framework.domain.archives.entity;

import ai.people.netmon.framework.domain.archives.vo.ArchivesVO;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 公司信息
 *
 * @author zhenglin
 * @since 2022-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@TableName(schema = "webservice",value = "person_archives_company_info")
public class ArchivesCompanyInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId
    private Long id;

    /**
     * 名称
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String name;

    /**
     * 地址
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String area;

    /**
     * 成立时间
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String establishmentTime;

    /**
     * 法定代表人
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String legalRepresentative;

    /**
     * 股东信息
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String shareholderInfo;

    /**
     * 企业类型
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String enterpriseType;

    /**
     * 工商注册号
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String icRegistrationNum;

    /**
     * 纳税人识别号
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String taxpayerIdentificationNum;

    /**
     * 纳税人资质
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String taxpayerQualification;

    /**
     * 统一社会信用代码
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String unifiedSocialCreditCode;

    /**
     * 人员规模
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String personnelScale;

    /**
     * 参保人员
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String insuredPersons;

    /**
     * 登记机关
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String registrationAuthority;

    /**
     * 所属行业
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String industry;

    /**
     * 公司情况
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String companySituation;

    /**
     * 基本信息ID
     */
    private Long baseInfoId;


    public ArchivesCompanyInfo(ArchivesVO.CompanyInfo companyInfo,Long baseInfoId){
        this.name = companyInfo.getName();
        this.area = companyInfo.getArea();
        this.establishmentTime = companyInfo.getEstablishmentTime();
        this.legalRepresentative = companyInfo.getLegalRepresentative();
        this.shareholderInfo = companyInfo.getShareholderInfo();
        this.enterpriseType = companyInfo.getEnterpriseType();
        this.icRegistrationNum = companyInfo.getIcRegistrationNum();
        this.taxpayerIdentificationNum = companyInfo.getTaxpayerIdentificationNum();
        this.taxpayerQualification = companyInfo.getTaxpayerQualification();
        this.unifiedSocialCreditCode = companyInfo.getUnifiedSocialCreditCode();
        this.personnelScale = companyInfo.getPersonnelScale();
        this.insuredPersons = companyInfo.getInsuredPersons();
        this.registrationAuthority = companyInfo.getRegistrationAuthority();
        this.industry = companyInfo.getIndustry();
        this.companySituation = companyInfo.getCompanySituation();
        this.baseInfoId = baseInfoId;
    }

    public ArchivesCompanyInfo(Long baseInfoId) {
        this.baseInfoId = baseInfoId;
    }
}
